package com.guigu.eduservice.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 广告表（管理PC端和小程序端的广告展示）
 * </p>
 *
 * @author Xiaosong
 * @since 2025-09-28
 */
@Data
@TableName("advertisement")
public class Advertisement implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 广告唯一标识
     */
    @TableId(value = "ad_id", type = IdType.AUTO)
    private Long adId;

    /**
     * 广告类型（0-小程序轮播广告，1-PC端广告）
     */
    private Boolean adType;

    /**
     * 广告展示位置（ad_type=1时必填，如首页顶部横幅、设备列表页侧边栏）
     */
    private String adPosition;

    /**
     * 广告图片URL（需符合对应端尺寸要求，如小程序轮播图建议750*300px）
     */
    private String adImage;

    /**
     * 广告跳转链接（可跳转至设备详情页、活动页、文章页）
     */
    private String jumpUrl;

    /**
     * 排序号（控制广告在轮播/列表中的展示顺序）
     */
    private Integer sort;

    /**
     * 广告开始时间（广告生效的起始时间）
     */
    private LocalDateTime startTime;

    /**
     * 广告结束时间（广告失效的时间，过期后不展示）
     */
    private LocalDateTime endTime;

    /**
     * 广告状态（0-禁用，1-启用；禁用后即使在有效期内也不展示）
     */
    private Boolean status;

    /**
     * 记录创建时间
     */
    private LocalDateTime createTime;

    /**
     * 记录更新时间
     */
    private LocalDateTime updateTime;

    public Long getAdId() {
        return adId;
    }

    public void setAdId(Long adId) {
        this.adId = adId;
    }

    public Boolean getAdType() {
        return adType;
    }

    public void setAdType(Boolean adType) {
        this.adType = adType;
    }

    public String getAdPosition() {
        return adPosition;
    }

    public void setAdPosition(String adPosition) {
        this.adPosition = adPosition;
    }

    public String getAdImage() {
        return adImage;
    }

    public void setAdImage(String adImage) {
        this.adImage = adImage;
    }

    public String getJumpUrl() {
        return jumpUrl;
    }

    public void setJumpUrl(String jumpUrl) {
        this.jumpUrl = jumpUrl;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "Advertisement{" +
            "adId = " + adId +
            ", adType = " + adType +
            ", adPosition = " + adPosition +
            ", adImage = " + adImage +
            ", jumpUrl = " + jumpUrl +
            ", sort = " + sort +
            ", startTime = " + startTime +
            ", endTime = " + endTime +
            ", status = " + status +
            ", createTime = " + createTime +
            ", updateTime = " + updateTime +
        "}";
    }
}
